package week07

import "strings"

// 58. 最后一个单词的长度
// https://leetcode-cn.com/problems/length-of-last-word/

func lengthOfLastWord(s string) int {
	s = strings.TrimSpace(s)
	ss := strings.Split(s, " ")
	if len(ss) > 0 {
		return len(ss[len(ss)-1])
	}
	return 0
}